package com.study.constrollers;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 *
 * Created by bunny on 2017/8/22.
 */

@Controller
public class TestController1 {
    @RequestMapping(value="/user/{userId}/roles/{roleId}",method = RequestMethod.GET)
    public String getLogin(
            @PathVariable("userId") String userId,
            @PathVariable("roleId") String roleId){
        System.out.println("User Id : " + userId);
        System.out.println("Role Id : " + roleId);

        return "hello";
    }
    @RequestMapping(value="/product/{productId}",method = RequestMethod.GET)
    public String getProduct(@PathVariable("productId") String productId){
        System.out.println("Product Id : " + productId);

        return "hello";
    }
    @RequestMapping(value="/javabeat/{regexp1}", method = RequestMethod.GET)
    public String getRegExp(@PathVariable("regexp1") String regexp1){
        System.out.println("URI Part 1 : " + regexp1);

        return "hello";
    }
}
